import { Controller, Get, Inject } from '@nestjs/common';
import { AppService } from './app.service';
import { CACHE_MANAGER } from '@nestjs/cache-manager';
import { Cache } from 'cache-manager';

@Controller()
export class AppController {
  constructor(private readonly appService: AppService, @Inject(CACHE_MANAGER) private cacheManager: Cache,) { }

  @Get()
  getHello(): string {
    this.cacheManager.set('APP_TOKEN_CACHE_KEY', 'hello', 600000);
    return this.appService.getHello();
  }
}
